package cn.com.task;

import java.util.Date;

public class TaskDemo implements Runnable{

    private int taskNum;

    public TaskDemo(int taskNum) {
        this.taskNum = taskNum;
    }

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println("taskNum：" + taskNum + "； " + new Date());
            if(taskNum == 1){
                int x = 1/0;
            }
            try {
                Thread.sleep(1000L);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
